/**
 * Copyright (c) [2020] China Canpool Team, All rights reserved.
 *
 * vlink is licensed under the Mulan PSL v1.
 * You can use this software according to the terms and conditions of the Mulan PSL v1.
 * You may obtain a copy of Mulan PSL v1 at:
 *
 *    http://license.coscl.org.cn/MulanPSL
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
 * FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v1 for more details.
 */

#include <stdint.h>
#include <stddef.h>

#ifndef __STYLE_H__
#define __STYLE_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/* defines */

#define STYLE_DEF_NAME      "name"
#define STYLE_DEF_VALUE     1

/* macros */

/*
 * min - get the min value of two
 * @x: the 1st value
 * @y: the 2nd value
 */
#ifndef min
#define min(x, y)           ((x) < (y) ? (x) : (y))
#endif

/* typedefs */

typedef struct style {
    char      * name;
    int         value;
} style_t;

enum style_type {
    STYLE_TYPE_C,
    STYLE_TYPE_CPP,
    STYLE_TYPE_PYTHON
};

/* inlines */

static inline int style_value(void) {
    return 1;
}

/* externs */

extern int      style_type      (void);
extern int      style_set_type  (int type);
extern char   * style_name      (void);
extern int      style_set_name  (const char *name);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __STYLE_H__ */
